Reduced hardware multiplier

ABSTRACT

The invention is directed to a multiplication apparatus or arrangement comprising: an address unit being adapted to receive address words from an external system, which address words have a first part comprising a first number X and a second part comprising a second number Y; a memory area comprising M×M memory cells arranged to be addressed by said address words, wherein a cell addressed by a particular address word is provided with the product P of the first and second number X and Y; and an output unit arranged to provide products P from the memory area to an external system. The invention is characterized in that the cells in the memory area addressed by address words wherein Y&lt;X have been removed.

FIELD OF THE INVENTION

The present invention relates to an apparatus or arrangement for multiplying numbers in connection with digital data processing. In particular, the invention relates to a table comprising the products from a finite number of multiplicands and multipliers. Even more particular, the invention relates to the space or area occupied by such a table.

BACKGROUND OF THE INVENTION

In connection with digital data processing, e.g. in Digital Signal Processing (DSP), there are frequently a need for multiplying various numbers to achieve certain functions or effects or other results, e.g. to accomplish different digital filters such as Finite Impulse Response (FIR-filters) etc, or to achieve different transforming operations such as the Fast Fourier Transform (FFT) etc. For such purposes there are a plurality of well known multipliers available in prior art, including multipliers implemented by software and multipliers implemented by hardware.

However, multipliers essentially implemented by software are in some situations to slow to fill the needs of modern digital signal processing, especially if the processing is performed in real-time. Therefore, in real-time applications and other applications in which the need for speed is crucial it is commonly preferred to use multipliers implemented by means of hard-ware, or at least essentially implemented by hardware.

Hardware multipliers in general are well known in the art. A hardware multiplier is commonly achieving a multiplication by means of a hardware-implemented algorithm. It is not uncommon that these algorithms replicates or imitates the human pen-and-paper way of performing a multiplication of two multi-digit numbers. Such algorithms may e.g. involve multiplying, shifting and adding.

FIG. 1 is a schematic illustration of the use of such an algorithm for multiplying two four-digit binary numbers A and B. As commonly known digit B₀ in the right most position of number B is first multiplying number A to form a first partial binary product B₀×A2⁰, wherein 2⁰ indicates that the least significant bit in the first partial product has the weight 2°. Digit B₁ in the next position of number B is then multiplying number A to form a second partial binary product B₁×A2¹, wherein 2¹ indicates that the least significant bit in the second partial product has the weight 2¹. This is repeated in a well known manner until all digits in number B have multiplied number A. All the partial products are then properly shifted and added in a well known manner to form the final product P, as schematically illustrated in FIG. 1. Naturally various hardware multipliers may use other algorithms and/or variants of the exemplifying algorithm now described.

As a contrast to the hardware multipliers essentially based on algorithms the present invention is directed to a lookup table comprising precalculated products corresponding to a finite number of multiplications.

The lookup table is typically a memory matrix, sized M rows times M columns (M equals 2N, with N as the ‘bit resolution’), where M−1 is the largest multiplicand possible. The products from the finite number of multiplications are precalculated and stored in the appropriate memory cells of the memory matrix. FIG. 2 shows a schematic illustration of an exemplifying multiplication memory matrix of the kind now discussed

The cells in the multiplication memory matrix shown in FIG. 2 are typically arranged so that the cell in position m,n comprises the product of m×n, meaning that the cell in position 0,0 comprises the product of 0x0, whereas the cell in position 0,M−1 comprises the product of 0x(M−1) etc. The precalculated product of m×n can then be retrieved in a well known manner by addressing the cell in position m,n using an address containing the numbers m and n, or an address containing numbers that correspond to the numbers m and n.

For the sake of simplicity the content of the memory cells may be thought of as integers, however the same applies mutatis mutandis for other formats such as fixed notations or float notations etc.

The multiplication memory matrix as schematically illustrated in FIG. 2 and similar memories or lookup tables are typically implemented on silicon or other materials that are suitable and commonly used for ordinary data memories or similar storage devices or DSP devices. In general the multiplication memory matrixes or lookup tables schematically described above occupy a considerable area of silicon or similar material on which they are implemented. This is especially so when the value of the multiplicand M−1 is high, since this creates large matrix structures with large memory cells for comprising large numbers.

Consequently there is a need for an improved multiplication memory matrix or lookup table or similar that occupies a smaller area or space.

SUMMARY OF THE INVENTION

The invention provides an improved multiplication memory apparatus or arrangement that occupies a smaller area or space.

This is accomplished by a multiplication arrangement comprising an address unit adapted to receive address words from an external system—e.g. an external digital signal processing system—wherein the address words have a first part comprising a first number X and a second part comprising a second number Y. The multiplication arrangement is also comprising a memory area having M×M memory cells or similar storage positions arranged to be addressed by said address words, wherein a cell addressed by a particular address word is provided with the product P of the first and the second number X and Y of the address in question. In addition, the multiplication arrangement comprises an output unit adapted to provide products P from the memory area to an external system—e.g. an external digital signal processing system.

The multiplication arrangement is characterized in that the cells in the memory area which are addressed by address words wherein Y<X have been removed, since these cells and the content therein are redundant due to the commutative property of the numbers being multiplied by the present invention. Hence, almost half of the memory area is removed.

This reduced memory area can be utilized by an embodiment wherein the address unit of the multiplication arrangement is arranged to swap the positions of said first and second address numbers X and Y in the address word if Y<X, and to forward the two swapped address numbers to the memory area. The address unit may alternatively be arranged to swap the positions of the first half and the second half of said address word, which implies that certain embodiments of the invention may swap other parts of the address word than the two halves. It should be emphasised that the address unit may be integrated into the multiplication arrangement or arranged as an external unit that is directly or indirectly communicating with the multiplication arrangement.

A further embodiment of the reduced memory area as described above is characterized in that the content of the cells addressed by address words wherein X=Y have been moved so as to replace the content of the cells addressed by an address word wherein X=0 and Y=Y. In other words, the content of the cells in the diagonal of the M×M memory area have been moved to replace the content of the cells in the column of the memory area wherein X=0, which enables a further reduction of the memory area.

This memory area is preferably utilized by an embodiment of the multiplication arrangement wherein said output unit is arranged to set the product P to zero when X=0 or Y=0.

This memory area can also be utilized by an embodiment of the multiplication arrangement wherein said address unit is arranged to swap the positions of said first and said second address numbers X and Y if Y<X, and arranged to set X to zero if X=Y, and further arranged to forward the address numbers X, Y to the memory area.

A further improvement of the memory area is possible, having the cells removed and moved as described above. This can be achieved by an embodiment wherein the content of cells in the memory area addressed by address words wherein X>=M/2 have been moved to replace the content in cells addressed by address words wherein X=M−1−X and Y=M−1−Y. In other words, a section of the memory area is mirrored in the diagonal of the memory area.

This memory area can be utilized by an embodiment of the multiplication arrangement wherein said address unit is arranged to swap the positions of said first and said second address numbers X and Y if Y<X, and arranged to set X to zero if X=Y, and arranged to invert the first and second numbers X and Y if the MSB of the first number X is set, and further arranged to forward the address numbers X, Y to the memory area. This makes it possible to reduce the width of the address buses or similar addressing the memory area of the multiplication memory matrix. It will also make it possible to implement a more symmetric and compact memory area.

The invention is also providing a method for addressing a multiplication memory arrangement as described above.

This is accomplished by a method for addressing a multiplication arrangement comprising: an address unit adapted to receive address words from an external system, which address words have a first part comprising a first number X and a second part comprising a second number Y; a memory area comprising M×M memory cells arranged to be addressed by said address words, wherein a cell addressed by a particular address word is provided with the product P of the first and second number X and Y of the address word; and an output unit (330) adapted to provide products P from the memory area (320) to an external system. The method comprises the steps of: removing the cells in the memory area (310) being addressed by address words wherein Y<X; receiving an address word from said external system; swapping the positions of said first and second numbers X and Y in said address word if Y<X; and forwarding the numbers X, Y of the address word to the memory area.

An embodiment of the method comprises the step of: swapping the positions of the first half and the second half of the received address word; and forwarding the address word to the memory area.

Another embodiment of the method comprises the step of: setting the product P to zero when X=0 or Y=0; and forwarding the product P to the output unit (330).

Still another embodiment of the method applied to the memory area (310) defined in the method step above comprises the steps of: moving the content of the cells being addressed by address words wherein X=Y to cells being addressed by address words wherein X=0 and Y=Y; setting the address number X in the received address word to zero if X=Y; and forwarding the address numbers X, Y to the memory area.

Still another embodiment of the method applied to the memory area (310) defined in the method steps above comprises the steps of: moving the content of the cells being addressed by address words wherein X>=M/2 to replace the content of cells being addressed by address words wherein X=M−1−X and Y=M−1−Y; inverting the first and second numbers X and Y in the received address if the MSB of the first number X is set; and forwarding the address numbers X, Y to the memory area (310).

These and other aspects of the present invention will be apparent from the following description of embodiment(s) of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic illustration of a binary multiplication algorithm replicating or imitating the paper-and-pen algorithm commonly used by humans when multiplying two decimal numbers.

FIG. 2 is a schematic illustration of an exemplifying lookup table implemented by means of a multiplication memory matrix.

FIG. 3 is a schematic illustration of an exemplifying multiplication memory matrix 300.

FIG. 4 is a table illustrating the links between the addresses, multiplicands, multipliers and products for the exemplifying multiplication memory matrix 300 in FIG. 3.

FIG. 5 illustrates the result from a swap of a first half and a second half of the word addressing the general multiplication memory matrix in FIG. 2.

FIG. 6 illustrates the result from a swap of a first half X and a second half Y of the word addressing the specific multiplication memory matrix 300 in FIG. 3.

FIG. 7 is the table in FIG. 4 amended so that the memory cells corresponding to the cells removed in the memory area 310 in FIG. 6 have been removed.

FIG. 8 illustrates an exemplifying hardware design for implementing a swap of the X and Y values when Y<X in the 6-bit address word addressing the memory area 310.

FIG. 9 illustrates an erasing of the zeroth column in the general multiplication memory matrix in FIG. 5.

FIG. 10 illustrates an erasing of the zeroth column in the memory area 310 of the specific multiplication memory matrix 300 in FIG. 6.

FIG. 11 illustrates an exemplifying hardware design for producing the product x·0=y·0=0.

FIG. 12 illustrates the general multiplication memory matrix in FIG. 9 having the content of the memory cells with an address value X=Y moved to the previously erased zeroth column.

FIG. 13 illustrates the memory area 310 shown in FIG. 10 having the content of the memory cells with an address value X=Y moved to the previously erased zeroth column.

FIG. 14 illustrates an exemplifying hardware design for implementing the move of the diagonal in the memory area 310 for the special cases when X=Y.

FIG. 15 illustrates a mirroring in the diagonal of a part of the general multiplication memory matrix shown in FIG. 12.

FIG. 16 illustrates a mirroring in the diagonal of a part of the memory area 310 in the specific multiplication memory matrix 300 shown in FIG. 13.

FIG. 17 illustrates an exemplifying hardware design for implementing a mirroring in the diagonal of a part of the multiplication matrix 300.

FIG. 18 is the table in FIG. 4 amended so that the memory cells corresponding to the cells removed in the memory area 310 in FIG. 16 have been removed.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS OF THE INVENTION

The present invention will now be described in more detail with reference to exemplifying embodiments thereof. Further embodiments of the invention are clearly conceivable and the invention is by no means limited to the embodiments of a multiplication memory matrix (lookup table) described below. In the following the same or similar reference numbers indicate the same or similar objects and/or functions throughout the whole text and in the appended drawings.

FIG. 3 shows a schematic illustration of an exemplifying multiplication memory matrix 300. The multiplication memory matrix 300 comprises a memory area 310, an address unit 320 and an output unit 330. The basic structure of the memory matrix 300 is preferably the same or at least very similar to the structure of an ordinary data memory implemented in a well known manner on a silicon structure or some other suitable hardware structure.

The memory area 310 in FIG. 3 has been limited to 8×8 memory cells, i.e. eight rows times eight columns of memory cells, wherein 8 equals 2³, with 3 as the “bit resolution” and wherein 8−1=7 is the largest multiplicand possible. However, it should be understood that the memory area 310 may have M rows times M columns of memory cells, wherein M equals 2N, with N as the “bit resolution” and wherein M−1 is the largest multiplicand possible, e.g. as schematically illustrated in FIG. 2.

The exemplifying address unit 320 is adapted to be connected to, and receive address signals or similar from, an external binary address-bus or similar of a digital data processing system or similar, e.g. in the same or very similar way as the address-bus of an ordinary data memory or similar addressable device. The address-bus connection is illustrated in FIG. 3 by an arrow labeled 6 a pointing to the address unit 320. The label 6 a indicates that the exemplifying binary address-bus is six bits wide, which implies that the binary address-bus is capable of addressing 2⁶=64 memory cells, i.e. 8×8 cells.

The exemplifying output unit 330 is adapted to be connected to an binary data-bus of an external digital data processing system for providing products of multiplications from the multiplication memory matrix 300 to said data-bus of said external system. In other words, the output unit 330 is adapted to be connected to an external data-bus in the same or similar way as the output data signals of an ordinary data memory or similar storing device. The data-bus connection is illustrated in FIG. 3 by an arrow labeled 6 p pointing away from the output unit 330. The label 6 p indicates that the exemplifying binary data-bus is six bits wide, which implies that the data-bus is capable of transferring a product from the exemplifying multiplication memory matrix 300 being as large as 63 (binary 111111). The output unit 330 receives the products to be outputted from the memory area 310 via an internal data-bus, which has been illustrated in FIG. 3 by an arrow labeled 6 p pointing away from the memory area 310 and towards the output unit 330. This label 6 p indicates that communication is six bits wide. In addition, the output unit 330 may also be provided with the 6-bit address-bus mentioned above, which will be further explained below. This has been illustrated in FIG. 3 by a dashed line labeled 6 a and pointing towards the output unit 330.

The basic function of the exemplifying multiplication memory matrix 300 in FIG. 3 is similar to the function of an ordinary data memory. Hence, when an address value is written to the address unit 320 a cell in the memory area 310 will be addressed and the content presently stored in the particular cell can be written to an external binary data-bus via the output unit 330. Consequently, the basic function of the memory matrix 300 in FIG. 3 enables a multiplication function to be achieved, provided that a product corresponding in a certain way to a particular address is pre-stored in the memory cell addressed by this particular address.

The addressing of the memory area 310 in the exemplifying multiplication memory matrix 300 in FIG. 3 is schematically illustrated by a first and a second arrow pointing away from the address-block 320 and towards the memory area 310. The label 3 on each of the two arrows indicates that the exemplifying 6-bit address-bus mentioned above has been divided in half by the address-block 320 resulting in two buses or sections each comprising 3-bits. The 3-bits represented by the first arrow carries the multiplicand and the 3-bits represented by the second arrow carries the multiplier, or the other way around. Hence, the two arrows in FIG. 3 is schematically illustrating that a first half of the 6-bit address-buss represents the multiplicand and the other half of the 6-bit address-bus represents the multiplier, or the other way around.

As already indicated above, it follows that a multiplication function can be achieved by pre-storing in the cell that will be addressed by a particular 6-bit address the product of the number represented by the 3-bits in the first half of the 6-bit address and the number represented by the 3-bits in the second half of the 6-bit address.

In other words, the individual cells of the multiplication memory matrix 300 in FIG. 3 are each provided with the product corresponding to the multiplicand and multiplier found in the first and the second half of their particular address.

Accordingly, the 8×8 memory cells schematically illustrated in the memory area 310 have been labeled with their respective multiplication, such that a cell addressed by X,Y is labeled XxY, i.e. the cell addressed by the address 0,0 is labeled 0x0 and the cell addressed by 1,1 is labeled 1x1 etc. The X,Y notation represents the address defined by the 6-bit address received from the 6-bit address-bus 6 p in FIG. 3, wherein X represents the value of the first half of the 6-bit address and Y represents the value of the second half of the 6-bit address, or possibly the other way around.

For the sake of simplicity the content of the memory cells in the memory area 310 may be thought of as integers, however the same applies mutatis mutandis for other formats such as fixed notations or float notations etc.

FIG. 4 shows a table illustrating the relation between the addresses, the multiplicands, the multipliers and the products for the exemplifying multiplication memory matrix 300 in FIG. 3. At the upper left end of the table is an upper box labeled “Address-Bus (6 bits, binary)”, which indicates that the two columns below comprise the binary values of the address received on the 6-bit address-bus 6 a in FIG. 3. Directly below said upper box there are two boxes of which the left box is labeled “1st half (3 bits binary)” and the right box is labeled “2nd half (3 bits binary)”. This indicates that the binary bits of the received G-bit address has been divided into two groups each comprising 3 bits. To the right of said upper box there are four upper boxes. The first box is labeled “Addr.”, the second “M1”, the third “M2” and the fourth “P”. The abbreviation “Addr.” represents the cell address in the memory matrix 300. The abbreviation “M1” and “M2” represent the multiplicand or multiplier, which multiplier and multiplicand are found in said first and second half of the address received from the 6-bit address-bus. The abbreviation “P” represents the product of said multiplicand and multiplier found in said first and second half of said address. Hence, the columns following below the boxes “Addr.”, “M1”, “M2” and “P” comprise values of the relevant addresses, the multiplicand/multiplier corresponding to these addresses, and the products of the multiplicands/multipliers in question. Below the boxes now referred to there is a row labeled “C0”. A similar row is repeated in every ninth row of the table in FIG. 4, which rows are labeled “On” where n is increased by one for every occurrence. These rows correspond to the columns 0 to 7 in the exemplifying memory area 310 in FIG. 3 and the different values below each row “Cn” (n=1-7) in the table of FIG. 4 correspond to the addresses, multiplicands, multipliers and products of the cells in the corresponding column of the memory area 310 in FIG. 3.

The invention is based on the observation that the addressing and storing of products in the multiplication memory matrix 300 is inefficient. Improvements of these conditions will now be described with reference to embodiments of the present invention.

As a starting point when describing an embodiment of the present invention it is observed that two arbitrary elements x and y of a set S are said to be commutative under a binary operation * if they satisfy:

x*y=y*x  (1)

Ordinary numbers such as integers etc are commutative under addition

x+y=y+x  (2)

and under multiplication

x·y=y·x  (3)

This observation makes it possible to reduce the size of the multiplication memory matrix 300 shown in FIG. 3 by means of some specific steps, which accomplish a modified and size-reduced multiplication memory matrix as will be described in more detail below.

Divide in the Diagonal

The fact that a multiplication of two numbers is commutative implies that almost half of the matrix 300 in FIG. 3 is a duplicate of the other half, i.e. almost every product occurs twice in the matrix 300. This can be easily established by looking at the memory area 310 of the exemplifying multiplication memory matrix 300 in FIG. 3, wherein almost every multiplication occurs twice. The same can be easily established by looking at the table in FIG. 4 illustrating the relation between the addresses, multiplicands, multipliers and products in the memory area 310 in FIG. 3, in which table almost every product “P” occurs twice.

Hence, due to the commutative property of the numbers in question almost half of the matrix 300 is redundant and it should therefore be possible to reduce the matrix 300 by half or almost half.

This can be accomplished if the above mentioned address values X and Y are always swapped when Y<X, which is a rather straight forward logic operation. Applied to the 6-bit address bus in the exemplifying multiplication memory matrix 300 this means that when the value X in the 1st half (3-bits) of the 6-bit bus is larger than the value Y in the 2nd half (3-bits) of the 6-bit bus a swap is performed on the two address values, which consequently exchange positions. A result of the swap is that the same 6-bit address is always pointed out regardless if the value in the 1st half is m and the value in the 2nd half is n, or if the value in the 1st half is n and the value in the 2nd half is m. This is clearly acceptable since the numbers X and Y are commutative implying that the product x·y is the same as the product y·x.

FIG. 5 illustrates the result from the swap described above performed on the general multiplication memory matrix previously shown in FIG. 2, wherein 2M memory cells can be addressed by a binary address word being M bits wide. As can be seen, all memory cells are removed having an address value X in the 1st half of an address word addressing the matrix that is larger than the address value Y in the 2nd half of said address word. This is illustrated by shading the removed cells with diagonal lines.

FIG. 6 shows the memory area 310 of the specific exemplifying multiplication memory matrix 300 previously shown in FIG. 3, wherein 2⁶ memory cells can be addressed by a binary address word being 6-bits wide. As can be seen, all memory cells are removed having an address value X in the 1st half of the binary word addressing the memory area 310 that is larger than the address value Y in the 2nd half of the binary address word. This is illustrated by double over striking lines in the removed cells.

The table in FIG. 7 is the same as the table previously shown in FIG. 4. However, the memory cells having the same addresses as the cells that are removed in the memory area 310 in FIG. 6 have also been removed in the table in FIG. 7. This is illustrated by double over striking lines in the removed cells.

FIG. 8 is a schematic illustration of an exemplifying hardware design for implementing the above mentioned swap of the X and Y values of the 6-bit address-bus in the matrix 300 when Y<X. It is preferred that the hardware design and the swap function are a part of the address unit 320, though other solutions are clearly conceivable. The hardware design in FIG. 8 comprises a swap section 810 and a comparing section 820. The swap section 810 is provided with the 6-bit address-bus and it is arranged to swap the values of X and Y with the effect that these values can be outputted on either one of the two 3-bit output buses from the address unit 320. The comparing section 820 is likewise provided with the 6-bit address-bus and it is arranged to compare the X and Y values and to actuate the swapping section to swap X and Y when Y<X. The actuating has been illustrated by a dashed line extending from the comparing section 820 through the six two-way switches in the swap section 810. It should be added that even if a hardware design is preferred for implementing the swap now described other embodiments of the invention may implement the swap by means of a fully or at least partly software-based design. This is especially so if the application is not time critical, which e.g. may be the case for applications that are not performed in real time.

Erase the Zeroth Column

Now, as it is true that x·0=y·0=0 the zeroth row and zeroth column can be removed in the general multiplication memory matrix in FIGS. 2 and 5, since no calculations for these cases are needed. However, the zeroth row has already been removed by the swapping operation described above, so there is only the zeroth column to remove.

FIG. 9 illustrates the erasing of the zeroth column in the general multiplication memory matrix previously shown in FIG. 5. As can be seen the content of the memory cells having an address value X=0 have been erased. The memory cells previously removed from the general matrix by the swap operation is shaded by dots and the zeroth column now erased is shaded by diagonal lines. Note that the cells in the zeroth column are erased but not removed, since they will be used in subsequent steps as will be further explained below.

FIG. 10 illustrates an erasing of the zeroth column in the memory area 310 of the specific multiplication memory matrix 300 previously shown in FIG. 6. As can be seen the content of the memory cells having an address value X=0 have been erased. The memory cells previously removed from the matrix 300 by the swap operation and the zeroth column now erased are marked with double over-striking lines Note that the cells in the zeroth column are erased but not removed, since they will be used in subsequent steps as will be further explained below.

FIG. 11 is a schematic illustration of an exemplifying hardware design for producing the product x=0=y·0=0. This can e.g. be accomplished by utilizing a switching section 1110 and a comparing section 1120. It is preferred that the switching section 1110 and the corn-paring section 1120 are a part of the output unit 330, though other solutions are clearly conceivable. The switching section 1110 is provided with a binary zero signal illustrated by a ground symbol and the product data form the memory area 310. The switching section 1110 is further arranged to send out binary zeroes on the 6-bit data-bus in a first switching position and to send out the binary product data on the 6-bit data-bus in a second switching position. The comparing section 1120 in the output unit 330 is in turn provided with the addresses from the 6-bit address-bus as schematically illustrated in FIG. 3 and it is arranged to compare the X and Y values of the addresses and to actuate the switching section 1110 so as to send out binary zeroes on the 6-bit data-bus if X=0 or Y=0, and to otherwise send out the binary product data received from the memory area 310 to the 6-bit data-bus. The actuating is illustrated by a dashed line extending from the comparing section 1120 through the six two-way switches in the switching section 1110. It can be observed that there is no need to address the memory area 310 to accomplish the multiplication x·0=y·0=0. It should also be added that even if a hardware design is preferred for implementing the switching now described other embodiments of the invention may implement the switch by means of a fully or at least partly software-based design. This is especially so if the application is not time critical, which e.g. may be the case for applications that are not performed in real time.

Move the Diagonal to the Erased Zeroth Column

Erasing the content of the relatively few elements in the zeroth column as discussed above may seem unnecessary. However, this is not so as will now be explained.

There is a special case so far omitted, namely the occasions when the above mentioned values X=Y. This must be taken care of, since a multiplication memory matrix of the kind now discussed will otherwise be too large. The solution is to map this special case (X=Y) into the memory cells of the zeroth column that was previously erased according to the discussion above. This can be accomplished by setting X=0 if X=Y, also a fast and easy logical operation. The relevant products are accordingly moved to the new address.

FIG. 12 illustrates the general multiplication memory matrix previously shown in FIG. 9. As can be seen, the content of the memory cells having an address value X=Y have been moved to the previously erased zeroth column. This results in a leftward horizontal movement in the memory matrix in FIG. 12, which is indicated by an arrow pointing to the left. In FIG. 12 the memory cells previously removed by the swap operation are shaded by dots. The diagonal now moved to the zeroth column is shaded by diagonal lines, whereas the zeroth column is shaded by perpendicular diagonal lines forming a square pattern.

FIG. 13 illustrates the memory area 310 of the specific multiplication memory matrix 300 previously shown in FIG. 10. As can be seen, the content of the memory cells having an address value X=Y have been moved to the corresponding memory cells having the same address value Y but the new address value X=0 instead of X=Y. This is illustrated by double over striking lines in the erased cells in the diagonal of the memory area 310.

FIG. 14 is a schematic illustration of an exemplifying hardware design for implementing the above described moving of the diagonal in the special case when X=Y. This can e.g. be accomplished by utilizing a switching section 1410 and a comparing section 1420 as shown in FIG. 14. It is preferred that the switching section 1410 and the comparing section 1420 are a part of the address-block unit 320, though other solutions are clearly conceivable. The switching section 1410 is provided with a binary zero signal illustrated by a ground symbol, and the addresses from the 6-bit address bus comprising the values X and Y as previously described. The switching section 1410 is arranged to switch the value of X between binary zero and the actual value of X received from the 6-bit address-bus. The comparing section 1420 is likewise provided with the addresses from the 6-bit address-bus and it is arranged to compare the values X and Y, and to actuate the switching section 1410 so as to set the value of X to binary zero when X=Y and to otherwise let the value of X pass unaffected. The actuating is illustrated by a dashed line extending from the comparing section 1420 through the three switches in the switching section 1410. It should be added that even if a hardware design is preferred for implementing the switching now described other embodiments of the invention may implement the switch by means of a fully or at least partly software-based design. This is especially so if the application is not time critical, which e.g. may be the case for applications that are not performed in real time. As can be seen in FIG. 14 the X and Y values of the 6-bit address bus are provided to the switching section 1410 via the previously described swapping section 810, which is in order since the swapping section leaves the X and Y values unaffected when X=Y, whereas the switching section 1410 leaves the X and Y values unaffected except when X=Y.

The above described moving of the memory cells from the diagonal to the zeroth column of the memory area 310 in FIG. 13 correspond to the following rearrangement in table format:

The table is a fragment of the table in FIG. 7. The memory cells provided with new values in the memory area 310 shown in FIG. 13 have also received new values in the above table, and the memory cells removed in the memory area 310 have also been erased in the above table. Erased values and erased cells are illustrated by double over-striking lines in the table and new values have been added next to the erased values where appropriate. The removed cells can be found below the shaded line in the table, whereas the new values are inserted in the cells above the shaded line.

Mirror in the Diagonal

The multiplication memory matrix accomplished so far still uses almost the full span of rows and columns, though more than half of the matrix is now removed. This is disadvantageous in many occasions especially considering that broader address-buses require more space than narrower buses in connection with silicon constructions etc. A further improvement can therefore be achieved by moving and refitting the upper right triangle of the general multiplication memory matrix in FIG. 12 into an empty area of the same size.

In FIG. 15 this rearranging of the modified general multiplication memory matrix previously shown in FIG. 12 has been illustrated by a curved arrow indication the moving direction of the memory cells. The movement indicated in FIG. 15 corresponds to a mirroring in the diagonal of the memory matrix. This can be achieved by letting the column X=M−1−X and the row Y=M−1−Y, when X>=M/2 in the multiplication memory matrix accomplished so far, i.e. the general multiplication memory matrix as illustrated in FIG. 12. Speaking in binary terms, this equals inverting X and Y when MSB of X is set, an easy logical operation.

FIG. 16 illustrates the mirroring in the diagonal of the memory area 310 in the specific multiplication memory matrix 300 previously shown in FIG. 13. In table format the following rearrangements have been made:

The above table is a fragment of the table in FIG. 7. The memory cells provided with new values in the memory area 310 shown in FIG. 16 have also received new values in the above table, and the memory cells removed in the memory area 310 have also been removed in the above table. Removed values and removed cells are illustrated by double over-striking lines in the table and new values have been added next to the erased values where appropriate. The removed cells can be found below the shaded row in the table, whereas the new values are inserted in the cells above the shaded row.

FIG. 17 is a schematic illustration of an exemplifying hardware design for implementing the above described mirroring in the memory area 310 of the specific multiplication memory matrix 300. This can e.g. be accomplished by utilizing an inverting section 1710 and a detecting section 1720 as shown in FIG. 17. It is preferred that the inverting section 1710 and the detecting section 1720 are a part of the address unit 320, though other solutions are clearly conceivable. The inverting section 1710 is provided with a modified version denoted 6 a′ of the original addresses on the 6-bit address bus denoted 6 a. The modified version 6 a′ is accomplished by swapping the X and Y values of the 6-bit address whenever Y<X and by setting the above mentioned X-values in the 6-bit address bus to zero whenever X=Y, as previously described above. The inverting section 1710 is further arranged to switch between outputting the modified address 6 a′ and outputting an inverted version of the modified address 6 a′. The comparing section 1720 is provided with the MSB of the X-values in the modified address 6 a′ and it is arranged to actuate a switch in the inverting section 1710 so as to output the modified address 6 a′ when the MSB of the X-value in the intermediate address 6 a′ is binary zero (0) and to output an inverted version of the intermediate address 6 a′ when the MSB of the X-value in the intermediate address 6 a′ is binary one (1). The actuating is illustrated by a dashed line extending from the comparing section 1720 through the 6-bit switch in the switching section 1710. It should be added that even if a hardware design is preferred for implementing the inverting now described other embodiments of the invention may implement the inverting function by means of a fully or at least partly software-based design. This is especially so if the application is not time critical, which e.g. may be the case for applications that are not performed in real time.

The table in FIG. 18 is the same as the table previously shown in FIG. 7. However, the memory cells provided with new values in the memory area 310 as discussed above have also received new values in this table, and the memory cells removed or erased in the memory area 310 have likewise been removed or erased in this table. Erased values and removed cells are illustrated by double over-striking lines in the table and new values have been added next to the erased values where appropriate.

From the above described embodiments of the present invention and as can be seen in the table of FIG. 18 it should be clear that a reduction of more than 50% of the memory matrix size is possible, especially when utilizing a hardware multiplier.

The invention has now been described by means of exemplifying embodiments. However, it should be added that the invention is by no means limited to the embodiments no described. On the contrary, the invention is intended to comprise all embodiments covered by the scope of the appended claims. For example, even though the multiplication memory matrix may have been illustrated as a regular quadratic matrix the invention is not limited to a certain physical design of the matrix. On the contrary, the cells of the matrix may be arranged in a row or in a circle or in some other suitable manner, including two dimensional structures as well as three dimensional structures. It should also be emphasized that the memory matrix may be implemented by means of a silicon structure or by means of any other suitable memory structure including magnetic or optical memory structures or any other suitable memory structure or media.

REFERENCE SIGNS

-   300 Multiplication Memory Matrix -   310 Memory Area -   320 Address Unit -   330 Output Unit -   810 Swapping Section -   820 Comparing Section -   1110 Switching Section -   1120 Comparing Section -   1410 Switching Section -   1420 Comparing Section -   1710 Inverting Section -   1720 Detecting Section -   6 a 6-bit Address-Bus -   6 a′ 6-bit Modified Address-Bus -   6 a″ 6-bit Modified Address-Bus -   6 a′″ 6-bit Modified Address-Bus -   6 p 6-bit Data-Bus 

1. A multiplication apparatus comprising: an address unit adapted to receive address words from an external system, which address words have a first part comprising a first number X and a second part comprising a second number Y; a memory area comprising M×M memory cells arranged to be addressed by said address words, wherein a cell addressed by a particular address word is provided with the product P of the first and second number X and Y; and an output unit adapted to provide products P from the memory area to an external system wherein the cells in the memory area addressed by address words wherein Y<X have been removed.
 2. The multiplication apparatus according to claim 1, wherein the content of the cells in the memory area addressed by address words wherein X=Y have been moved to replace the content of the cells addressed by an address word wherein X=O and Y=Y.
 3. The multiplication apparatus according to claim 1, wherein the content of cells in the memory area addressed by address words wherein X>=M/2 have been moved to replace the content of cells addressed by address words wherein X=M−1−X and Y=M−1−Y.
 4. The multiplication apparatus according to claim 1, wherein said address unit is arranged to swap the positions of said first and second address numbers X and Y if Y<X, and to forward the address numbers X, Y to the memory area.
 5. The multiplication apparatus according to claim 1, wherein said address unit is arranged to swap the positions of the first half of the address word and the second half of the address word, and to forward the address word to the memory area.
 6. The multiplication apparatus according to claim 2, characterized in that the output unit is arranged to set the product P to zero when X=0 or Y=0.
 7. The multiplication apparatus according to claim 2, wherein said address unit is arranged to swap the positions of said first and said second address numbers X and Y if Y<X, and —set X to zero if X=Y; and forward the address numbers X, Y to the memory area.
 8. The multiplication apparatus according to claim 3, wherein said address unit is arranged to: swap the positions of said first and said second address numbers X and Y if Y<X; set X to zero if X=Y; invert the first and second numbers X and Y if the MSB of the first number X is set; and forward the address numbers X, Y to the memory area.
 9. A method for addressing a multiplication apparatus having an address unit that receives address words from an external system, which address words have a first part comprising a first number X and a second part comprising a second number Y, a memory area comprising M×M memory cells arranged to be addressed by said address words, wherein a cell addressed by a particular address word is provided with the product P of the first and second number X and Y of the address word, and an output unit adapted to provide products P from the memory area to an external system, the method comprising the steps of: removing the cells in the memory area being addressed by address words wherein Y<X; receiving an address word from said external system; swapping the positions of said first and second numbers X and Y in said address word if Y<X; and forwarding the numbers X, Y of the address word to the memory area.
 10. The method according to claim 9, further comprising the step of swapping the positions of the first half and the second half of the received address word.
 11. The method according to claim 9, further comprising the steps of: setting the product P to zero when X=0 or Y=0; and forwarding the Product P to the output unit.
 12. The method according to claim 9, comprising the steps of: moving the content of the cells in the memory area being addressed by address words wherein X=Y to cells being addressed by address words wherein X=O and Y=Y; setting the address number X in the received address word to zero if X=Y; and forwarding the address numbers X, Y to the memory area.
 13. The method according to claim 12, comprising the steps of: moving the content of the cells being addressed by address words wherein X>=M/2 to replace the content of cells being addressed by address words wherein X=M−I−X and Y=M−I−Y; inverting the first and second numbers X and Y in the received address if the MSB of the first number X is set; and forwarding the address numbers X, Y to the memory area. 